export default {
  text_format(tag, maxLenth) {
    if (tag == null) return null;
    if (tag == null) return null;
    if (tag.length > maxLenth)
      return tag.toString().substring(0, maxLenth) + "...";
    else
      return tag;
  },
  create_uuid(){
    return this.s4() + this.s4() + '-' + this.s4() + '-' + this.s4() + '-' +
      this.s4() + '-' + this.s4() + this.s4() + this.s4();
  },
  s4() {
    return Math.floor((1 + Math.random()) * 0x10000)
      .toString(16)
      .substring(1);
  }
}
